package com.ate.testday1;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.ate.testday1.base.Xia;
import com.ate.testday1.presenter.MyPresenter;

import java.util.List;

public class MainActivity extends AppCompatActivity {
    private EditText ed1;
    private EditText ed2;
    private Button btn1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        MyPresenter myPresenter = new MyPresenter(this);
        myPresenter.get();

        ed1 = (EditText) findViewById(R.id.ed1);
        ed2 = (EditText) findViewById(R.id.ed2);
        btn1 = (Button) findViewById(R.id.btn1);

        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String s = ed2.getText().toString();
                int length = s.length();
                if (length<8){
                    Toast.makeText(MainActivity.this, "密码不能小于八位", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
    public void onSuccess(List<Xia.DataBean> list){
        Toast.makeText(this, ""+list.toString(), Toast.LENGTH_SHORT).show();
    }
    public void onError(String msg){

    }
}
